Conventionally, a scanner reads an image on a sheet conveyed by an ADF based on a size of the sheet determined from user inputs or sensor data generated by sheet size detection sensors installed on a sheet tray of the ADF. As the size of the ADF has become smaller in recent years, the sheet conveying distance measured from the tray to the scanner has also become shorter. As a result, it is difficult to measure the actual size of the conveyed sheets prior to scanning them. Therefore, the scanner generates image data of the conveyed sheets based on a maximum size of the conveyed sheets, and not their actual size. This may not be problematic if the conveyed sheets are of the same size but leads to scanning an unnecessarily large area and generating unnecessary image data if some of the sheets are smaller in size than the maximum size.